<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8">


		<title>w0923_3</title>
		<script>
			function show(){
				var n;
				n = document.getElementById("userName").value;
				document.getElementById("i1").innerHTML=n;
			}
		</script>
	</head>

	<body>
		<!--이름, id = frm인 폼요소 
			  한 줄짜리 text 이름,id = userName 
			  click이라고 쓰여진 버튼 
			  id가 i1인 div요소 -->

		<script>
		
		//	document.write("<h2>입력</h2>");
		//	prompt();
			
			//var a = 'hong';
		
			document.write("<h2> 입력 </h2>");
			//var a =confirm('수락하시겠습니까?');
			//var a = alert("나는 alert");
			//document.write("변수값:" + a);
			
			var a = alert("나는 alert");
			window.document.write("변수 값:" + a);
		</script>
		
		
				<form name="frm" id="frm">
			<input type="text" name="userName" id="userName" />
			<input type="button" value="click" onclick="show()" /> 
			
		</form>
		<div id="i1"></div>
	</body>
</html>
